#include <iostream>
#include <math.h>
using namespace std;

class Ctriangle
{
  private:
    bool check()
    {
        if (A + B > C && A + C > B && B + C > A)
        {
            return true;
        }
        return false;
    }

  protected:
    float A, B, C;

  public:
    Ctriangle(int a = 0, int b = 0, int c = 0)
    {
        A = a, B = b, C = c;
    }

    float area()
    {
        if (!check())
        {
            return 0;
        }
        float p = (A + B + C) / 2;
        float s1 = p - A, s2 = p - B, s3 = p - C;
        return sqrt(p * s1 * s2 * s3);
    }

    float perimeter()
    {
        return A + B + C;
    }
};

int main()
{
    Ctriangle mc(3, 4, 57);
    printf("面积: %f\n", mc.area());
    printf("周长: %f\n", mc.perimeter());
}